<?php
global $_RQ,$_AR;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'edit';
$return=array();
	if($_RQ['op']=='edit'){
	$item=$this->plugin_setting('setting');
    $return['item']=$item;
	
	$return['status']=array('1'=>'开启','0'=>'关闭');
	$htmls=array(
		'type'=>'edit',
		'post'=>'post',
		'desc'=>'参数设置',
		'edit'=>array(
			array('name'=>'appkey','title'=>'AppKey','type'=>'string','help'=>'请在“https://open.ys7.com/开通服务并新建应用，获取对应配置信息'),
			array('name'=>'secret','title'=>'Secret','type'=>'string','help'=>'请在“https://open.ys7.com/开通服务并新建应用，获取对应配置信息'),
			array('type'=>'radio','title'=>'用户控制摄像头权限','name'=>'open','options'=>'status','help'=>'如果开启则用户可以在监控页面开启或关闭摄像头'),
			
			)
			);
	$return['htmls']=$htmls;
	
	exi($return);
	}
	if($_RQ['op']=='post'){
	$postdata=get_postdata();
	$data=array_fields(array('appkey','secret','open'),$postdata);
	$item=$this->plugin_setting('setting',$data);
	exi('设置成功');
}
?>